﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace Mark_dal
{
    public class yuanselect
    {
        DBHelper db = new DBHelper();
        public DataTable xianshi()
        {

            return (db.GetTable("select * from AdminInfo where Adminrole=1"));
        }
        public DataTable ytjxianshi(string Text)
        {
            string sql = string.Format("select * from AdminInfo where AdminName like '%{0}%' and Adminrole=1", Text);

            return (db.GetTable(sql));
        }

        public int shanchu(string adminid)
        {
           
            string sql = string.Format(@"DELETE FROM [AdminInfo]
      WHERE AdminId={0}", adminid);
           int jilu= db.ExecuteNoQuery(sql);
           db.Close();
           return jilu;
        }
    }
}
